home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
sndpas.zip
/
DEMO.DOC
< prev
next >
Wrap
Text File
|
1989-03-09
|
3KB
|
52 lines
SOUNDPAS.ARC
Turbo Pascal Sound Generation
Nels Anderson
92 Bishop Drive
Framingham, MA 01701
SOUNDPAS.ARC demonstrates two ways to generate sounds using Turbo Pascal.
The simpler method uses tables to generate sound effects in real time.
The other method replaces the clock tick interrupt to handle sounds in
the background. This is also a good demonstration of Turbo Pascal
interrupts in general.
Turbo Pascal includes a Sound() function that allows simple tones to be
generated. With a little work, Sound() can be expanded to make sound
effects that are generated from simple tables. The first demonstration,
using the Pascal unit SOUNDEFF.PAS and the demo file DEMO1.PAS shows a
simple way to generate sounds from tables. Notice that execution of
the program stays in the sound generation procedure for the duration of
the sound.
The second method uses an interrupt that is installed in place of the
normal clock tick interrupt. This allows a sound to be generated
without making the rest of the program stop. The table of sounds will
continue to be generated until the table ends even while the rest of
the program continues. This allows songs to be played while a program
is running for example. I use this method in my game EGATrek and I've left
in the sound tables that I use. There are two full songs plus a couple
of random sound effects. The demo program, DEMO2.PAS, just plays one
of the songs. Change the demo program around to hear the other sound
tables. The interrupt unit is called SOUNDER.PAS.
The units and demos have enough documentation in them that you should
be able to understand them if you're familiar with Turbo Pascal.
These routines are released to the public domain. However, if you do
use them I would like to hear from you about what you're doing with
them. I'd also be interested in any new sound effects that you come up
with. You can write me at the address on the top of this file, or
contact me on the Xevious BBS system (508-875-3618 or 617-449-7322,
300-9600 baud, PCBoard 14.0). If you're connected to one of the minicomputer
nets (InterNet, uucp...) you can try reaching me at one of these addresses:
ima!primerd!en-m32.prime.com!nja
uunet!en-m32.prime.com!nja
csnet-relay!en-m32.prime.com!nja
nja%en-m32.prime.com@relay.cs.net
nja@en-m32.prime.com